import re


# 将匹配的数字乘于 2
def double(matched):
    value = int(matched.group('value1'))
    return str(value * 2)


s = 'A23G4HFD567'
print(re.sub('(?P<value1>\d+)', double, s))
# p = "(?P<value>\d+)"
# c = re.compile(p)
# res = c.search(p)
# print(res)
# print()
